package org.zpmis.domain.order.service.impl;

import org.zpmis.domain.order.dao.OrderMapper;
import org.zpmis.domain.order.model.Order;
import org.zpmis.domain.order.service.OrderService;
import org.zpmis.common.service.AbstractService;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.transaction.annotation.Transactional;
import org.zpmis.domain.order.vo.OrderCountReceived;
import org.zpmis.domain.order.vo.OrderReceived;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;


/**
 * Created with CodeGenerator
 * Description:
 * @author  Yang
 * Date: 2021-6-2
 * Time: 14:51:37
 */
@Service
@Transactional
public class OrderServiceImpl extends AbstractService<Order> implements OrderService {

    @Resource
    private OrderMapper orderMapper;

    @Override
    public Long getOrderCount(Long startTime,Long endTime) {
        Map<String,Object> param = new HashMap<>();
        param.put("startTime",startTime);
        param.put("endTime",endTime);
        return orderMapper.getOrderCount(param);
    }

    @Override
    public List<OrderReceived> getOrderReceived(Long startTime, Long endTime) {
        Map<String,Object> param = new HashMap<>();
        param.put("startTime",startTime);
        param.put("endTime",endTime);
        return orderMapper.getOrderReceived(param);
    }

    @Override
    public List<OrderCountReceived> getOrderCountReceived(Long startTime, Long endTime) {
        Map<String,Object> param = new HashMap<>();
        param.put("startTime",startTime);
        param.put("endTime",endTime);
        return orderMapper.getOrderCountReceived(param);
    }
}
